package com.jianggy.chainofrespon.json;

/**
 * @author jianggy
 * @time 2018年9月13日 上午9:56:39
 * @description
 */
public class App {
	public static void main(String[] args) {
		JsonRequest request = new JsonRequest("{\"actions\":[{\"type\":\"a\"},{\"type\":\"b\"},{\"type\":\"c\"}]}");
		JsonResponse response = new JsonResponse();
//		HandlerChain chain = new HandlerChain(new AHandler(), new BHandler(), new CHandler());
//		chain.doParse(request, response, chain);
//		response.display();
		
		try {
			HandlerChain chain = HandlerChainFactory.getInstance();
			chain.doParse(request, response, chain);
			response.display();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
}
